//package com.douqu.game.main.platform;
//
//import cn.uc.g.sdk.cp.model.SDKException;
//import cn.uc.g.sdk.cp.model.SessionInfo;
//import cn.uc.g.sdk.cp.service.SDKServerService;
//import com.alibaba.fastjson.JSONObject;
//import com.douqu.game.core.entity.sprite.Player;
//import com.douqu.game.core.protobuf.SGCommonProto;
//import com.douqu.game.core.util.Utils;
//import com.douqu.game.main.service.PlayerService;
//import org.apache.log4j.Logger;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
//* Author : Bean
//* 2017-05-22 18:28
//*/
//@Component
//public class UCImpl implements PlatformSDK {
//
//    Logger logger = Logger.getLogger(this.getClass());
//
//    @Autowired
//    private PlayerService playerService;
//
//    @Override
//    public Player login(String account, String password, String ip) {
//
//        try {
//            SessionInfo sessionInfo = SDKServerService.verifySession(account);
//
//            logger.debug("UC获取玩家数据："+ JSONObject.toJSONString(sessionInfo));
//
//            account = Utils.createAccount(sessionInfo.getAccountId(), SGCommonProto.E_CHANNEL_TYPE.CHANNEL_TYPE_UC);
//            Player player = playerService.getPlayerByAccount(account);
//            if(player == null)
//            {
//                player = new Player();
//            }
//
//            return player;
//        } catch (SDKException e) {
//            e.printStackTrace();
//        }
//        return null;
//    }
//}
